using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
namespace CoreLib
{
  public   class Mouse:CInputComponent
    {
        static ButtonState  leftButton;
        static  ButtonState rightButton;
      static ButtonState middleButton;
      static int scrollWheelValue;
      static int x;
      static int y;
      static ButtonState xButton1;
      static ButtonState xButton2;
        public static ButtonState LeftButton
        {
            get { return leftButton; }
            set { leftButton = value; }
        }
        public static ButtonState RightButton
        {
            get { return rightButton; }
            set { rightButton = value; }
        }
      public static ButtonState MiddleButton
      {
          get { return middleButton; }
          set { middleButton = value; }
      }

      public static int ScrollWheelValue
      {
          get { return scrollWheelValue; }
          set { scrollWheelValue = value; }
      }

      public static int X
      {
          get { return x; }
          set { x = value;
          Microsoft.Xna.Framework.Input.Mouse.SetPosition(x, y);
      }
      }
      public static int Y
      {
          get { return y; }
          set { y= value;
          Microsoft.Xna.Framework.Input.Mouse.SetPosition(x, y);
      }
      }
      public static ButtonState XButton1
      {
          get { return xButton1; }
          set { xButton1 = value; }
      }
      public static ButtonState XButton2
      {
          get { return xButton2; }
          set { xButton2 = value; }
      }

      public Mouse(Game game)
          : base(game)
      {
      }
      public override void Update(GameTime gameTime)
{
       MouseState state;
       state = Microsoft.Xna.Framework.Input.Mouse.GetState();
       LeftButton = state.LeftButton;
       RightButton = state.RightButton;
       MiddleButton=state.MiddleButton;
       ScrollWheelValue=state.ScrollWheelValue;
       X=state.X;
       Y=state.Y;
       XButton1=state.XButton1;
       XButton2=state.XButton2;
         
       return;
}
    }
   
}
